import { request } from "@/utils/service"
import * as Operation from "./types/operation"

/** 查 */
export function getUsableSpaceDataApi() {
  return request<Operation.GetUsableSpaceResponseData>({
    url: "yw/getUsableSpace",
    method: "get"
  })
}

/** 下载 */
export function downloadBackupApi() {
  return request<Operation.DownloadResponseData>({
    url: `yw/downloadSqlFile`,
    method: "get",
    responseType: "blob"
  })
}

/** 获取文件列表 */
export function getSqlFileListApi(data: Operation.IGetSqlFileListRequestData) {
  return request<Operation.GetSqlFileListResponseData>({
    url: `yw/getSqlFileList`,
    method: "get",
    params: data
  })
}
